package cn.iocoder.idata.module.idata.dal.mysql.object;

import java.util.*;

import cn.iocoder.idata.framework.common.pojo.PageResult;
import cn.iocoder.idata.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.idata.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.idata.module.idata.dal.dataobject.object.ObjectDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.idata.module.idata.controller.admin.object.vo.*;

/**
 * 标注物管理 Mapper
 *
 * @author wanghaiyang
 */
@Mapper
public interface ObjectMapper extends BaseMapperX<ObjectDO> {

    default PageResult<ObjectDO> selectPage(ObjectPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ObjectDO>()
                .likeIfPresent(ObjectDO::getName, reqVO.getName())
                .orderByDesc(ObjectDO::getId));
    }

    default List<ObjectDO> selectList(ObjectExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<ObjectDO>()
                .likeIfPresent(ObjectDO::getName, reqVO.getName())
                .orderByDesc(ObjectDO::getId));
    }

}
